use crate::config::create_settings_service;

#[tauri::command]
pub async fn set_setting(key: String, value: String) -> Result<(), String> {
    let settings_service = create_settings_service();
    settings_service.set_setting(&key, &value).unwrap();
    Ok(())
}

#[tauri::command]
pub async fn get_setting(key: String) -> Result<Option<String>, String> {
    let settings_service = create_settings_service();
    Ok(settings_service
        .get_setting(&key)
        .expect("Failed to get setting"))
}
